<?xml version='1.0' encoding='UTF-8' ?>
<!--
    Document   : product
    Created on : 16 Jul 11, 11:02:04
    Author     : Administrator
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/templates/page.xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:define name="title">Product</ui:define>

    <ui:define name="content">
        <h:form id="form">
            <ice:panelGroup styleClass="exampleBox selectionContainer" >
            <ice:outputText value="MASTER PRODUCT" style="font-weight: bolder; font-size: 20px"/><br/><br/><br/>
            <ice:panelGrid columns="2" styleClass="verticalAlignTop" >
                <ice:inputText id="txtId" binding="#{productBean.txtId}" rendered="false"/>
                <ice:outputText value="Client Name"/>
                <ice:inputText disabled="true"/>
                <ice:outputText value="Client Department"/>
                <ice:selectOneMenu id="somClientDept" binding="#{productBean.somClientDept}"
                                   value="#{productBean.selectedClientDept}">
                    <f:selectItems value="#{productBean.clientDepts}"/>
                </ice:selectOneMenu>
                <ice:outputText value="Product Name"/>
                <ice:inputText id="txtName" binding="#{productBean.txtName}" disabled="true"/>
                <ice:outputText value="Product Information"/>
                <ice:inputText binding="#{productBean.txtInformation}" disabled="true"/>
                <ice:outputText value="Product Type"/>
                <ice:inputText disabled="true"/>
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </ice:panelGrid>
            <ice:panelGroup>
                <ice:commandButton binding="#{productBean.btnAdd}" value="Add" action="#{productBean.add_action()}"/>
                <ice:commandButton binding="#{productBean.btnEdit}" value="Edit" action="#{productBean.edit_action()}" rendered="false"/> 
                <ice:commandButton binding="#{productBean.btnRemove}" value="Remove" action="#{productBean.remove_action()}" rendered="false"/> 
                <ice:commandButton binding="#{productBean.btnSave}" value="Save" action="#{productBean.save_action()}" rendered="false"/> 
                <ice:commandButton binding="#{productBean.btnCancel}" value="Cancel" action="#{productBean.cancel_action()}" rendered="false"/> 
            </ice:panelGroup>
            </ice:panelGroup>
            
            <!-- DataTable with RowSelector Component -->
            <ice:panelGroup styleClass="exampleBox">
                <ice:jsEventListener 
                    events="keyup" handler="dmlListener"
                    actionListener="#{productBean.jsListener}">                            
                    <ice:dataTable id="dt"
                                    var="item"
                                   value="#{productBean.products}"
                                   rows="10" 
                                   columnClasses="tableCol">
                        <ice:column>
                            <ice:rowSelector id="selected"
                                             selectionListener="#{productBean.rowSelectionListener}"
                                             />
                            <f:facet name="header"><ice:outputText value="ID"/></f:facet>
                            <ice:outputText id="Number" value="#{item.productId}"/>
                        </ice:column>

                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Client Name"/></f:facet>
                            <ice:outputText value="#{item.clientId}"/>
                        </ice:column>
                        
                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Client Department"/></f:facet>
                            <ice:outputText value="#{item.rmsClientDept.clientDeptName}"/>
                        </ice:column>
                        
                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Product Name"/></f:facet>
                            <ice:outputText value="#{item.productName}"/>
                        </ice:column>
                        
                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Product Information"/></f:facet>
                            <ice:outputText value="#{item.productInformation}"/>
                        </ice:column>

                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Product Type"/></f:facet>
                            <ice:outputText value="#{item.rmsProductType.productTypeName}"/>
                        </ice:column>

                        <ice:column>
                            <f:facet name="header"><ice:outputText value="Active"/></f:facet>
                            <ice:outputText value="#{item.productIsactive}"/>
                        </ice:column>
                    </ice:dataTable>
                </ice:jsEventListener> 
            </ice:panelGroup>

            <ice:panelGroup style="float:left;width:420px;">
                <center>
                    <ice:dataPaginator id="dataScroll_1"
                                       for="dt"
                                       fastStep="5"
                                       paginator="true"
                                       paginatorMaxPages="10">
                        <f:facet name="first">
                            <ice:graphicImage id="firstpage_1"
                                              url="/assets/styles/icefusion/css-images/arrow-first.gif"
                                              style="border:none;"
                                              title="First Page"/>
                        </f:facet>
                        <f:facet name="last">
                            <ice:graphicImage id="lastpage_1"
                                              url="/assets/styles/icefusion/css-images/arrow-last.gif"
                                              style="border:none;"
                                              title="Last Page"/>
                        </f:facet>
                        <f:facet name="previous">
                            <ice:graphicImage id="previouspage_1"
                                              url="/assets/styles/icefusion/css-images/arrow-previous.gif"
                                              style="border:none;"
                                              title="Previous Page"/>
                        </f:facet>
                        <f:facet name="next">
                            <ice:graphicImage id="nextpage_1"
                                              url="/assets/styles/icefusion/css-images/arrow-next.gif"
                                              style="border:none;"
                                              title="Next Page"/>
                        </f:facet>
                        <f:facet name="fastforward">
                            <ice:graphicImage id="fastforward_1"
                                              url="/assets/styles/icefusion/css-images/arrow-ff.gif"
                                              style="border:none;"
                                              title="Fast Forward"/>
                        </f:facet>
                        <f:facet name="fastrewind">
                            <ice:graphicImage id="fastrewind_1"
                                              url="/assets/styles/icefusion/css-images/arrow-fr.gif"
                                              style="border:none;"
                                              title="Fast Backward"/>
                        </f:facet>
                    </ice:dataPaginator>
                </center>
            </ice:panelGroup>
        </h:form>
    </ui:define>
</ui:composition>